package com.ysjweb.dish.Mapper;

import com.ysjweb.dish.pojo.dish;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.ArrayList;

@Mapper
public interface DishMapper {
    public dish GetDishById(Integer id);//

    public void AddDish(dish dish);

    @Select("SELECT LAST_INSERT_ID()")
    public Integer GetDishId();

    @Select("SELECT name from menu")
    public ArrayList<String> GetDishName();

    @Select("SELECT id from menu where name=#{name}")
    public Integer GetDishIdByName(String dishName);

    //获取菜品做法
    @Select("SELECT process,element from menu where name=#{name}")
    public String GetProcessByName(String dishName);

    @Select("SELECT picture from menu where id=#{id}")
    public String GetPictureById(Integer id);

    @Select("select video from menu where id=#{id}")
    public String GetVideoById(Integer id);
}
